
{% macro head() %}
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>{% if page.title %}{{ page.title }}{% else %}{{ config.title }}{% endif %}</title>
  <meta name="description" content="{% if page.description %}{{ page.description | striptags | trim | truncate(length=160) }}{% else %}{{ config.description }}{% endif %}">

  <link rel="stylesheet" href="{{ config.base_url ~ "/main.css" }}">
</head>
{% endmacro head %}

{% macro footer() %}
<footer class="footer">
    <p>&copy; {{ config.extra.username }}</p>
    <p>Ported to Zola with <span class="love">❤</span> by <a href="https://github.com/svavs">Silvano Sallese</a> (original by <a href="https://github.com/nrandecker">Nathan Randecker</a>)</p>
</footer>
<script src="//cdn.jsdelivr.net/particles.js/2.0.0/particles.min.js"></script>
<script src="{{ config.base_url ~ "/js/sweet-scroll.min.js" }}"></script>
<script src="{{ config.base_url ~ "/js/main.js" }}"></script>
{% endmacro footer %}

{% macro header() %}
<div id="particles-js">
  <div class="header">
      <h1>
        <span class="site-title">{{ config.extra.username }}</span>
        <span class="site-description">{{ config.extra.user_title | linebreaksbr | safe }}</span>
      </h1>
      <div class="header-icons">
        <a aria-label="Send email" href="#"><i class="icon fa fa-envelope"></i></a>
        <a aria-label="My Twitter" target="_blank" href="#"><i class="icon fa fa-twitter" aria-hidden="true"></i></a>
        <a aria-label="My Google Plus" target="_blank" href="#"><i class="icon fa fa-google-plus" aria-hidden="true"></i></a>
        <a aria-label="My Github" target="_blank" href="#"><i class="icon fa fa-github-alt" aria-hidden="true"></i></a>
      </div>
      <div class="header-links">
        <a class="link" href="#about" data-scroll>About Me</a>
        <a class="link" href="#projects" data-scroll>Projects</a>
      </div>
  </div>
  <a class="down" href="#about" data-scroll><i class="icon fa fa-chevron-down" aria-hidden="true"></i></a>
</div>
{% endmacro header %}

{% macro google_analytics() %}
<!-- Google Analytics -->
{% if config.extra.google_analytics %}
<script>
var dnt = navigator.doNotTrack || window.doNotTrack || navigator.msDoNotTrack;
if (dnt != "1" && dnt != "yes") {
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{ config.extra.google_analytics.id }}', 'auto');
ga('send', 'pageview');
}
</script>
{% endif %}
{% endmacro google_analytics %}
